﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace mesoBoard.Data
{
    public interface IRankValidation
    {
        [Required(ErrorMessage="Enter rank title")]
        string Title { get; set; }

        [RegularExpression(@"^\d{1,7}$", ErrorMessage="Enter a valid post count")]
        [Required(ErrorMessage = "Enter a post count")]
        int PostCount { get; set; }

        [RegularExpression(@"^\d{1,7}$", ErrorMessage = "Enter a valid repeat number")]
        [Required(ErrorMessage = "Enter a repeat number")]
        [Range(1, int.MaxValue, ErrorMessage="Minimum 1 repeat")]
        int Repeat { get; set; }


    }


    [MetadataType(typeof(IRankValidation))]
    public partial class Rank : IRankValidation { } 


}
